﻿<navigation:Page  x:Class="SomethingSpacial.Views.Admin.EventList" 
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
            xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" 
            xmlns:activity="clr-namespace:System.Windows.Controls;assembly=ActivityControl"
            xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"  
            xmlns:dataControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit" 
            xmlns:vm="clr-namespace:SomethingSpacial.ViewModel"
            xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
            Title="EventList Page">
            <UserControl.DataContext>
                <vm:EventsViewModel x:Name="vmEvents"  />
            </UserControl.DataContext>

            <StackPanel x:Name="LayoutRoot" Margin="0"  Height="479"  Style="{StaticResource ContentStackPanelStyle}" >


                <!-- Page Content -->
                <StackPanel x:Name="stackPanelContent"  Orientation="Horizontal">

					<!-- Listing Panel-->
					<Border x:Name="borderList" HorizontalAlignment="Left" Margin="0,0,10,10" VerticalAlignment="Top" CornerRadius="10" BorderThickness="1" BorderBrush="Black" Padding="10" Background="#FFFAFAFA" Width="500">
	            		<StackPanel x:Name="stackPanelList" Orientation="Vertical" VerticalAlignment="Top" Background="White" Margin="0" d:LayoutOverrides="Width" Height="450" HorizontalAlignment="Left">
            			    <TextBlock x:Name="textBlockListingHeader" Text="Event Listing" TextWrapping="Wrap" FontWeight="Bold" FontSize="13.333" Foreground="#FF1D1472" HorizontalAlignment="Left"/>
                 
                            <activity:Activity x:Name="activityContent" IsActive="{Binding IsBusy, ElementName=dds}" VerticalAlignment="Top" HorizontalAlignment="Left">
            				    <data:DataGrid x:Name="gridEvents" Height="378" Width="450" IsReadOnly="True" AutoGenerateColumns="False" HorizontalAlignment="Left" 
            					    HorizontalScrollBarVisibility="Disabled"   VerticalAlignment="Top"                                                   
            					    ItemsSource="{Binding Events}" Margin="0"  >
            					    <data:DataGrid.Columns>
                                            <data:DataGridTextColumn Header="ID"                  Binding="{Binding EventID}" Width="50"  />
                                            <data:DataGridTextColumn Header="Event Name"  Binding="{Binding TopicTitle}" Width="300" />
                                    </data:DataGrid.Columns>
            				    </data:DataGrid>
            			    </activity:Activity>

                			<StackPanel x:Name="stackPanelActionButtons" Orientation="Horizontal" VerticalAlignment="Bottom" Grid.Row="2" d:LayoutOverrides="Width" Margin="0,0,0,1" Height="39">
                				<Button x:Name="buttonAddNew" Content="Add New" Width="105" Height="28" 	Margin="5,0,0,0" HorizontalAlignment="Left" Click="AddNew_Click" />
                				<Button x:Name="buttonSubmit" Content="Update" Width="105" Height="28" Click="SubmitButton_Click"	/>
                				<Button x:Name="buttonDelete" Content="Delete" Width="105" Height="28"	Click="DeleteButton_Click"	Margin="5,6,0,5"	/>
                			</StackPanel>
                		</StackPanel>

                	</Border>

            	<!-- Details StackPanel-->
            	<Border x:Name="borderDetails" HorizontalAlignment="Left" Margin="0" VerticalAlignment="Top" Width="500" d:LayoutOverrides="GridBox" CornerRadius="10" BorderThickness="1" BorderBrush="Black" Padding="10" Background="#FFFAFAFA">
            		<StackPanel x:Name="stackPanelDetails" Orientation="Vertical" VerticalAlignment="Top" Height="450" Width="450" HorizontalAlignment="Left">
            			<TextBlock x:Name="textBlockHeaderDetails" FontSize="13.333" FontWeight="Bold" Foreground="#FF1D1472" Text="Event Details" TextWrapping="Wrap" Margin="0,0,40,0" d:LayoutOverrides="Width" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                    		<dataControls:DataForm x:Name="editDataForm" Height="378" Width="450" 	VerticalAlignment="Top"  Header=""
                    			CurrentItem="{Binding SelectedItem, ElementName=gridEvents}" d:LayoutOverrides="GridBox" HorizontalAlignment="Left" Margin="0" HeaderVisibility="Collapsed" >
                    			<dataControls:DataForm.EditTemplate>
                    				<DataTemplate>
                    					<StackPanel>
                    						<dataControls:DataField Label="Topic Title:" >
                    							<TextBox Text="{Binding TopicTitle, Mode=TwoWay}"  Width="200" HorizontalAlignment="Left" />
                    						</dataControls:DataField>
                                            <dataControls:DataField Label="Description:">
                                                <TextBox Text="{Binding  TopicDescription, Mode=TwoWay}" Width="280" Height="120" HorizontalAlignment="Left"  TextWrapping="Wrap" />
                                            </dataControls:DataField>
                    						<dataControls:DataField Label="Location"  HorizontalAlignment="Left" >
                    							<ComboBox   x:Name="comboBoxLocations" Width="150" />
                    						</dataControls:DataField>
                                            <dataControls:DataField Label="Start Date" x:Name="textStartDate" >
                                                <controls:DatePicker Text="{Binding When, Mode=TwoWay}" Width="100"  HorizontalAlignment="Left" ></controls:DatePicker>
                                            </dataControls:DataField>
                                            <dataControls:DataField Label="Start Time" x:Name="textStartTime">
                                                <TextBox Text="" Width="80" HorizontalAlignment="Left" x:Name="textBlockTime"  />
                                            </dataControls:DataField>
                                            <dataControls:DataField Label="Registration URL:">
                                                <TextBox Text="{Binding MeetingInvite, Mode=TwoWay}" HorizontalAlignment="Left" Width="200"  />
                                            </dataControls:DataField>
                                        </StackPanel>
                    				</DataTemplate>
                    			</dataControls:DataForm.EditTemplate>


                    		</dataControls:DataForm>
                    	</StackPanel>

                    </Border>

                    <!-- Detail Panel-->

                </StackPanel>           
        
        </StackPanel>
        
</navigation:Page>
